package com.fly.springbootTemplate.serviceImpl;

import com.fly.springbootTemplate.dao.StudentCourseDao;
import com.fly.springbootTemplate.entity.StudentCourse;
import com.fly.springbootTemplate.service.StudentCourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class StudentCourseServiceImpl implements StudentCourseService {
    @Autowired
    private StudentCourseDao studentCourseDao;

    @Override
    public boolean addCourse(StudentCourse studentCourse) {
        return studentCourseDao.addCourse(studentCourse);
    }

    @Override
    public boolean deleteCourse(String courseId) {
        return studentCourseDao.deleteCourse(courseId);
    }

    @Override
    public boolean updateCourse(StudentCourse studentCourse) {
        return studentCourseDao.updateCourse(studentCourse);
    }

    @Override
    public List<StudentCourse> getAllCourse() {
        return studentCourseDao.selectAllCourse();
    }

    @Override
    public StudentCourse getCourseById(String courseId) {
        return studentCourseDao.selectCourseById(courseId);
    }
}
